﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Data.Objects;
using Data.Entities;

namespace Data.Configuration
{
    public class BankAccountConfiguration : EntityConfiguration<BankAccount>
    {
        public BankAccountConfiguration()
        {
            Property(ba => ba.BankAccountID).IsIdentity();

            //Definimos que existe um relacionamento com person que é requerido
            Relationship<Person>(p => p.Person).FromProperty(b => b.BankAccount).IsRequired();
        }
    }
}
